<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>图书馆座位预约系统 - 登录</title>
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <style>
        /* 全局样式 */
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background: linear-gradient(135deg, #6a11cb, #2575fc);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            color: #333;
        }

        /* 容器样式 */
        .container {
            background: #fff;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            width: 100%;
            max-width: 400px;
            text-align: center;
        }

        h2 {
            margin-bottom: 1.5rem;
            color: #333;
            font-size: 1.8rem;
        }

        /* 错误提示样式 */
        .error {
            color: #ff4757;
            background: #ffe6e6;
            padding: 0.5rem;
            border-radius: 5px;
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }

        /* 表单样式 */
        form {
            display: flex;
            flex-direction: column;
        }

        label {
            text-align: left;
            margin-bottom: 0.5rem;
            font-weight: bold;
            color: #555;
        }

        input {
            padding: 0.8rem;
            margin-bottom: 1rem;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
            transition: border-color 0.3s ease;
        }

        input:focus {
            border-color: #6a11cb;
            outline: none;
        }

        /* 按钮样式 */
        button {
            padding: 0.8rem;
            background: #6a11cb;
            color: #fff;
            border: none;
            border-radius: 5px;
            font-size: 1rem;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        button:hover {
            background: #2575fc;
        }

        /* 注册链接样式 */
        p {
            margin-top: 1rem;
            font-size: 0.9rem;
            color: #555;
        }

        a {
            color: #6a11cb;
            text-decoration: none;
            font-weight: bold;
        }

        a:hover {
            text-decoration: underline;
        }

        /* 导航栏样式 */
        nav {
            position: fixed;
            bottom: 0;
            width: 100%;
            background: rgba(255, 255, 255, 0.9);
            padding: 1rem 0;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        }

        nav ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            justify-content: center;
        }

        nav ul li {
            margin: 0 1rem;
        }

        nav ul li a {
            color: #333;
            text-decoration: none;
            font-weight: bold;
            transition: color 0.3s ease;
        }

        nav ul li a:hover {
            color: #6a11cb;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>图书馆座位预约系统 - 登录</h2>
    <p th:if="${error}" class="error">用户名或密码错误</p>
    <form action="/users/login" method="post">
        <label for="username">用户名:</label>
        <input type="text" id="username" name="username" required>

        <label for="password">密码:</label>
        <input type="password" id="password" name="password" required>

        <button type="submit">登录</button>
    </form>
    <p>没有账号？<a href="/register">立即注册</a></p>
</div>
<nav>
    <ul>
        <li><a href="/seats">座位选择</a></li>
        <li><a href="/history">预约历史</a></li>
        <li><a href="/announcements">公告</a></li>
    </ul>
</nav>
</body>
</html>